<?
    final class Principio_Model_MenuItem implements PrincipioLab_IDAble
    {
        private $id;
        private $caption;
        private $action;

        public function __construct($caption, $action, $id)
        {
            $this->id = $id;
            $this->caption = $caption;
            $this->action = $action;
        }

        public function _getID() { return $this->id; }

        public static function fromArray(array $values = null)
        {
            $i = 0;
            $linked_list = new PrincipioLab_LinkedList();

            foreach ($values as $caption => $action)
            {
                $linked_list->addItem(new Principio_Model_MenuItem($caption, $action, $i));
                $i++;
            };

            return $linked_list;
        }


        public function getCaption() { return $this->caption; }
        public function getAction() { return $this->action; }
    }
?>